<template>
    <div class="show">
            <div class="leftPanel">
                <div class="seachTitle" @click="changItem(1)">项目查询</div>
                <div class="seachPanel">
                    <div class="seachTitle" @click="changItem(2)">专题展示</div>
                    <el-menu default-active="1" class="el-menu-vertical-demo" background-color="beige">
                        <el-submenu index="1">
                            <template slot="title">
                                <span>审批单位</span>
                            </template>
                            <el-menu-item-group>
                            <template slot="title"></template>
                                <el-menu-item index="1-1">延安市新区经济发展局</el-menu-item>
                                <el-menu-item index="1-2">省发改委</el-menu-item>
                                <el-menu-item index="1-3">市发改委</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                    </el-menu>
                </div>
            </div>
            <base-map  :projectsInfo="projectsInfo"></base-map>
    </div>
</template>

<script>
    import baseMap from "../common/Map.vue"
    import bus from "../../assets/bus.js"
    import {projectType} from "../tool/Global/app-config.js";
    import {queryProjectdetail} from "../tool/Global/app-mgr.js";
    export default {
        components:{
            baseMap
        },
        data:function(){
            return {
                projectType:[{name:'全部',value:'0'}].concat(projectType),                
                selectType:"",
                selectProgress:"",
                minNum:"",
                maxNum:"",
                projExaminationOrg:"",
                projectsInfo: [],
                type:"",
                projExaminationOrgS:YanAnAPP.projExaminationOrgS
            }
        },
        mounted:function(){
            this.getProjectsInfo();

        },
        methods:{
            search(){
                if(this.selectType!=""  || this.minNum!="" || this.maxNum!="" || this.projExaminationOrg!=""){
                    let ref = this;
                    this.getProjectsInfo(function(result){
                        if(result.data.success){
                            ref.$message({message:"查询成功",type:"success"});
                        }else{
                            ref.$message.error(result.data.message);
                        }
                    });
                }else{
                    this.$message({message:"请输入查询条件",type:"warn"});
                }
            },
            getProjectsInfo(callback){
                var self = this;
                var params = {
                    projType:this.selectType?this.selectType:null,
                    projexaminationorg:this.projExaminationOrg?this.projExaminationOrg:null,
                    minRealInvestment:this.minNum?this.minNum:null,
                    maxRealInvestment:this.maxNum?this.maxNum:null
                }
                queryProjectdetail(params).then(function(result){
                    if(result.data.success){
                        self.projectsInfo = result.data.data.datalist;
                    }
                    if(typeof(callback)=="function"){
                        callback(result);
                    }
                })

            },
            changItem(val){
                bus.$emit("changeshowItem",val);
            }
        }
    }
</script>
<style scoped>
    .show{
        height:100%;
        position: relative;
    }
    .leftPanel{
        height: 100%;
        width: 15%;
        float: left;
        background-color: white;
    }
    .handle-select{
        width:126px;
        margin-left:15px;
        margin-top:20px;
    }
    .handle-input{
        width:120px;
        margin-left:15px;
        margin-top:20px;
    }
    .seachPanel{
        width:96%;
        height:400px;
        border: 1px solid #d6eefc;
        margin-left:2%;
        margin-top:10px;
    }
    .seachTitle{
        width:100%;
        height:38px;
        background-image: url("../../../static/img/show/leftTitle.png");
        margin-top:10px;
        background-size: 100% 100%;
        line-height: 38px;
        color: #248bc8;
        text-align: center;
        font-weight: 700;
        cursor:pointer;
    }

</style>

